package com.tjec.framework.web.domain;

import java.io.Serializable;
import java.util.List;
import java.util.stream.Collectors;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.tjec.project.businessWorkbench.domain.BmsBusinessTask;
import com.tjec.project.businessWorkbench.domain.BmsProjectDocCatalog;
import com.tjec.project.system.domain.BmsMdBusinessCategory;
import com.tjec.project.system.domain.SysDept;
import com.tjec.project.system.domain.SysMenu;

/**
 * Treeselect树结构实体类
 * 
 * @author pangyognfeng
 */
public class TreeSelectNew implements Serializable
{
    private static final long serialVersionUID = 1L;

    /** 节点ID */
    private String guid;

    /** 节点名称 */
    private String label;
    
    /** 顺序 **/
    private double sort;
    
    /** 文件夹权限标识 **/
    private String flag;
    
    /** 文件数量 **/
    private Integer counts;

    /** 子节点 */
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<TreeSelectNew> children;

    public TreeSelectNew()
    {

    }
    
    public TreeSelectNew(BmsMdBusinessCategory businessCategory)
    {
        this.guid = businessCategory.getGuid();
        this.label = businessCategory.getMenuName();
        this.children = businessCategory.getChildren().stream().map(TreeSelectNew::new).collect(Collectors.toList());
    }
    
    public TreeSelectNew(BmsBusinessTask bmsBusinessTask)
    {
        this.guid = bmsBusinessTask.getGuid();
        this.label = bmsBusinessTask.getName();
        this.children = bmsBusinessTask.getChildren().stream().map(TreeSelectNew::new).collect(Collectors.toList());
    }
    
    public TreeSelectNew(BmsProjectDocCatalog bmsProjectDocCatalog)
    {
        this.guid = bmsProjectDocCatalog.getGuid();
        this.label = bmsProjectDocCatalog.getName();
        this.sort = bmsProjectDocCatalog.getSort();
        this.flag = bmsProjectDocCatalog.getIsEdit();
        this.counts = bmsProjectDocCatalog.getCounts();
        this.children = bmsProjectDocCatalog.getChildren().stream().map(TreeSelectNew::new).collect(Collectors.toList());
    }

    public String getGuid()
    {
        return guid;
    }

    public void setId(String guid)
    {
        this.guid = guid;
    }

    public String getLabel()
    {
        return label;
    }

    public void setLabel(String label)
    {
        this.label = label;
    }

    public List<TreeSelectNew> getChildren()
    {
        return children;
    }

    public void setChildren(List<TreeSelectNew> children)
    {
        this.children = children;
    }

	public double getSort() {
		return sort;
	}

	public void setSort(double sort) {
		this.sort = sort;
	}

	public String getFlag() {
		return flag;
	}

	public void setFlag(String flag) {
		this.flag = flag;
	}

	public Integer getCounts() {
		return counts;
	}

	public void setCounts(Integer counts) {
		this.counts = counts;
	}
}
